package entities;

// Generated Dec 2, 2014 11:11:56 AM by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 * Danhmuc generated by hbm2java
 */
@Entity
@Table(name = "danhmuc", catalog = "thuviecdatabase")
@XmlRootElement
public class Danhmuc implements java.io.Serializable {

	private Integer danhmucid;
	private String loaitl;
	private Set<Tailieucongty> tailieucongties = new HashSet<Tailieucongty>(0);

	public Danhmuc() {
	}

	public Danhmuc(String loaitl, Set<Tailieucongty> tailieucongties) {
		this.loaitl = loaitl;
		this.tailieucongties = tailieucongties;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "danhmucid", unique = true, nullable = false)

	public Integer getDanhmucid() {
		return this.danhmucid;
	}

	public void setDanhmucid(Integer danhmucid) {
		this.danhmucid = danhmucid;
	}

	@Column(name = "loaitl", length = 45)
	public String getLoaitl() {
		return this.loaitl;
	}

	public void setLoaitl(String loaitl) {
		this.loaitl = loaitl;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "danhmuc")
	@XmlTransient
	public Set<Tailieucongty> getTailieucongties() {
		return this.tailieucongties;
	}

	public void setTailieucongties(Set<Tailieucongty> tailieucongties) {
		this.tailieucongties = tailieucongties;
	}

}
